<?php

namespace app\common\model;

use app\common\business\BusPartner;

class MachineCate extends Base
{
    protected $deleteTime='delete_time';

    /**
     * @param $value
     * @return int|mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    protected function getCommissionAttr($value){
        if($value == 0){
            return 0;
        }
        $commission = (new BusPartner())->getPartnerBySurplus($value);

        return $commission ?? 0;
    }
}